<?php

class Familymember_Form_Edit extends Engine_Form {
	public function init() {
		$this->setTitle ( 'Edit Family Member' )->setDescription ( 'Select a proper relation.' )->setAttrib ( 'class', 'global_form_popup' );
		
		$types = Engine_Api::_ ()->getDbTable ( 'type', 'familymember' )->fetchAll ();
		$arr = array ('-- Select --' );
		foreach ( $types as $type ) {
			$arr [$type->type_id] = $type->title;
		}
		
		$this->addElement ( 'select', 'relation', array ('multiOptions' => $arr ) );
		
		$this->addElement ( 'Checkbox', 'delete', array ('prependText' => ' or ', 'label' => 'Delete this relation' ) );
		
		$this->addElement ( 'Button', 'submit', array ('label' => 'Update', 'type' => 'submit', 'ignore' => true, 'decorators' => array ('ViewHelper' ) ) );
		
		$this->addElement ( 'Cancel', 'cancel', array ('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => '', 'onclick' => 'parent.Smoothbox.close();', 'decorators' => array ('ViewHelper' ) ) );
		$this->addDisplayGroup ( array ('submit', 'cancel' ), 'buttons' );
	}
}